home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (c) 1991 NeXT Computer, Inc. All rights reserved.
- *
- * IOSCSIController.h - Abstract SCSI Controller superclass. Public API is in
- * bsd/dev/scsiTypes.h.
- *
- * HISTORY
- * 11/9/92 Brian Pinkerton at NeXT
- * Created from Doug Mitchell's NRW version.
- */
-
- #import <driverkit/IODevice.h>
- #import <driverkit/i386/directDevice.h>
- #import <driverkit/return.h>
- #import <driverkit/scsiTypes.h>
-
- @interface IOSCSIController : IODirectDevice<IOSCSIControllerExported>
- {
- @private
- /*
- * Target/lun reservation array. We reserve target SC_HOST_ID for
- * ourself. We keep track of how many active devices are on the bus
- * in _reserveCount.
- */
- id _reserveArray[SCSI_NTARGETS][SCSI_NLUNS];
- unsigned int _reserveCount;
- id _reserveLock; // NXSpinLock. Protects _reserveArray.
- unsigned _worstCaseAlign; // worst case DMA alignment.
- }
-
- - initFromDeviceDescription : deviceDescription;
- - (IOReturn) attachInterruptPort;
-
- - (unsigned int)numReserved;
-
- - (IOReturn)getIntValues : (unsigned *)parameterArray
- forParameter : (IOParameterName)parameterName
- count : (unsigned int *)count;
-
- - (IOReturn)setIntValues : (unsigned *)parameterArray
- forParameter : (IOParameterName)parameterName
- count : (unsigned int)count;
-
- - (unsigned int) numQueueSamples; /* simple statistics */
- - (unsigned int) sumQueueLengths;
- - (unsigned int) maxQueueLength;
-
- - (void)resetStats; /* zero the above counters */
-
- /*
- * Methods in IOEISADirectDevice overridden here. These are nops for
- * EISA machines.
- */
- - (void)reserveDMALock;
- - (void)releaseDMALock;
-
- /*
- * Subclasses of SCSIController must implement the following two
- * methods of the SCSIControllerExported protocol.
- * SCSIController's versions of these return SR_IOST_INVALID.
- *
- * - (sc_status_t) executeRequest : (IOSCSIRequest *)scsiReq
- * buffer : (void *)buffer
- * client : (vm_task_t)client;
- *
- * - (sc_status_t) resetSCSIBus;
- *
- *
- * May optionally be overridden by subclass.
- *
- * - (unsigned) maxTransfer;
- * - (void)getDMAAlignment : (IODMAAlignment *)alignment;
- */
-
- /*
- * These two are called out from the I/O thread; they indicate
- * the receipt of either an interrupt message or a timeout
- * (msg_id = IO_TIMEOUT_MSG) message.
- */
- - (void)interruptOccurred;
- - (void)timeoutOccurred;
-
- /*
- * May be overridden by subclass to handle device-specific messages received
- * by the I/O thread. Superclass's version merely logs an error.
- */
- - (void)handleMessage : (msg_header_t *)message;
-
- @end
-
- #define IO_IS_A_SCSI_CONTROLLER "IOIsASCSIController"
- #define IO_SCSI_CONTROLLER_STATS "IOSCSIControllerStatistics"
-
- #define IO_SCSI_CONTROLLER_STAT_ARRAY_SIZE 3
- #define IO_SCSI_CONTROLLER_MAX_QUEUE_LENGTH 0
- #define IO_SCSI_CONTROLLER_QUEUE_SAMPLES 1
- #define IO_SCSI_CONTROLLER_QUEUE_TOTAL 2
-
-
-